﻿using System;
using Microsoft.Xna.Framework;
using WindowsGame.Enums;
using WindowsGame.Input;

namespace WindowsGame.Manager
{
	public interface IInputManager
	{
		void Update(GameTime gameTime);
		Boolean Escape();
		Boolean Load();
		Direction Rotate();
		Boolean Thrust();
		Boolean Brake();
		Boolean Shoot();
		Boolean Next();
		Boolean Prev();
	}

	public class InputManager : IInputManager
	{
		private readonly IInputFactory inputFactory;

		public InputManager(IInputFactory inputFactory)
		{
			this.inputFactory = inputFactory;
		}

		public void Update(GameTime gameTime)
		{
			inputFactory.Update(gameTime);
		}
		public Boolean Escape()
		{
			return inputFactory.Escape();
		}
		public Boolean Load()
		{
			return inputFactory.Load();
		}
		public Direction Rotate()
		{
			return inputFactory.Rotate();
		}
		public Boolean Thrust()
		{
			return inputFactory.Thrust();
		}
		public Boolean Brake()
		{
			return inputFactory.Brake();
		}
		public Boolean Shoot()
		{
			return inputFactory.Shoot();
		}
		public Boolean Next()
		{
			return inputFactory.Next();
		}
		public Boolean Prev()
		{
			return inputFactory.Prev();
		}
	}
}
